function [s_jt, der_jt] = f_share( ...
    price_jt,   ...
    theta,      ...
    Pi,         ...
    rho,        ...
    x_jt,       ...
    xnonlin_jt, ...
    xi_jt,      ...
    dfull_jt    ...
)

    x_jt(:, 1)       = price_jt;
    xnonlin_jt(:, 1) = price_jt;

    delta = x_jt * theta + xi_jt;
    mu    = (xnonlin_jt * Pi) .* dfull_jt;
    dmu   = exp((delta + mu) / (1 - rho));

    I_i1rt  = (1 - rho) * log(sum(dmu));
    sgroup  = exp(I_i1rt) ./ (1 + exp(I_i1rt));
    scond   = dmu ./ sum(dmu);
    share   = scond .* sgroup;
    pcoef   = theta(1) + dfull_jt .* Pi(1);

    der_jt  = rcnl_der_price(rho, share, scond, pcoef);
    s_jt    = mean(share, 2);
end
